<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MyTeams.aspx.cs" Inherits="ProcolDemo.MyTeams"
    MasterPageFile="~/MasterPage.master" Title="My Teams" %>
    <%@ Import Namespace="ProcolDemo.MyTeamsReference"%>

<asp:Content ID="Content1" ContentPlaceHolderID="PHtitle" runat="Server">
    ProCol
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="PHCSS" runat="Server">
    <link rel="stylesheet" href="CSS/index.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="CSS/modalbox.css" type="text/css" media="screen" />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PHsidebar" runat="Server">
    <div id="myideas">
    <h1>
        <asp:Label ID="AUTO_TEAM_MYTEAMS" runat="server" />
    </h1>
    <p>
        <br />
        <table width="200">
        <asp:PlaceHolder ID="TeamListMenu" runat="server"></asp:PlaceHolder>
        </table>
    </p>
    </div>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="PHcontent" runat="Server">
<script type="text/javascript" src="js/scriptaculous/lib/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous/src/scriptaculous.js?load=builder,effects"></script>
<script type="text/javascript" src="js/modalbox.js"></script>

<!-- Updates of My TEAMS -->

<asp:Panel ID="updates" runat="server">
<div class="contentContainerFollow">
        <asp:Panel ID="newsMemberTitle" runat="server">
            <h1>
                <asp:Label ID="AUTO_START_MEMBERNEWS" runat="server" />
            </h1>
        </asp:Panel>
        <asp:Panel ID="newsMemberContent" runat="server">
            <div class="contenttext">
            <!-- Variables -->
            
            <asp:HiddenField ID="teamIdHF" runat="server" />
            <asp:HiddenField ID="teamOIDHF" runat="server" />
            <asp:HiddenField ID="userRoleField" runat="server" />
            
            
                <asp:Repeater ID="rptMembers" runat="server">
                    <HeaderTemplate>
                        <table border="0" width="100%" cellpadding="0" cellspacing="0">
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr>
                            <td width="30%">
                                <span class="h2content">
                                    <%# DataBinder.Eval(Container.DataItem, "FeedTitle")%></span>
                            </td>
                            <td width="65%">
                                <span class="h2Any">
                                    <%# DataBinder.Eval(Container.DataItem, "FeedContent")%>
                                </span>
                            </td>
                            <td width="5%" align="left">
                                <a href="<%# DataBinder.Eval(Container.DataItem, "FeedLink")%>" class="h2More">
                                    <!-- <img src="/images/more.png" width="16" height="16" alt="" border="0" style="vertical-align: middle;" /> -->
                            </td>
                        </tr>
                    </ItemTemplate>
                    <FooterTemplate>
                        </table>
                    </FooterTemplate>
                </asp:Repeater>
            </div>
        </asp:Panel>
</div>            
</asp:Panel>


<!-- Tabbed Panels for all My Teams -->
 <asp:Repeater ID="ShowMyTeams" runat="server">
 <ItemTemplate>
 <div class="contentContainerFollow">
 <asp:Panel ID="title" runat="server" >
    <h1>
        <%# ((TeamBean)Container.DataItem).projectName %>
        <asp:Image ID="img" runat="server" ImageUrl="images/expand.jpg" />
    </h1>
  </asp:Panel>
  <asp:Panel ID="content" runat=server >
  <!-- Content info for each team -->
    <div class="myteam"><!-- mycollaboration -->
        <div class="contenttext">
            <h1>
                <asp:Label ID="AUTO_TEAM_INFO" runat="server" />
                <img src= "images/users_family.png" border="0" />
            </h1>
            <table width="100%" cellpadding="0" cellspacing="0">
                <tr>
                    <td width="40%" valign="top" align="left">
                        <span class="h2projects"><asp:Label ID="AUTO_TEAM_PROJECTNAME" runat="server" />: </span>
                    </td>
                    <td width="60%" valign="top" align="left">
                        <asp:Label ID="lblProjectName" runat="server">
                            <a href="/Projects.aspx?op=projectInfo&projectId=<%# ((TeamBean)Container.DataItem).projectId %>"><%# ((TeamBean)Container.DataItem).projectName %></a>
                        </asp:Label>
                        </td>
                </tr>
                <tr>
                    <td valign="top" align="left">
                        <span class="h2projects"><asp:Label ID="AUTO_TEAM_NAME" runat="server" />: </span>
                    </td>
                    <td valign="top" align="left">
                    <asp:Label ID="lblTeamName" runat="server">
                      <%# ((TeamBean)Container.DataItem).teamName %>
                    </asp:Label>
                    </td>
                </tr>
                <tr>
                    <td valign="top" align="left">
                        <span class="h2projects"><asp:Label ID="AUTO_TEAM_RATING" runat="server" />: </span>
                    </td>
                    <td valign="top" align="left">
                        <ajaxToolkit:Rating runat="server" ID="UserRating" MaxRating="5" CurrentRating="2"
                            CssClass="ratingStar" StarCssClass="ratingItem" WaitingStarCssClass="Saved" FilledStarCssClass="Filled"
                            EmptyStarCssClass="Empty" Height="16px" Width="135px" ReadOnly="true" />
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <div class="membersContent"><!-- contentContainerFollow -->
        <div class="contenttext">
            <h1>
                <asp:Label ID="AUTO_TEAM_MEMBERS" runat="server" />
                <img src= "images/address_book3.png" border="0" />
            </h1>
            <p>
                <table id="membersTable" width="100%">
                <asp:HiddenField ID="teamIdHF" Value="<%# ((TeamBean)Container.DataItem).teamId %>" />
                <asp:Repeater ID="ShowMyTeams" runat="server" DataSource="<%# ((TeamBean)Container.DataItem).memberList %>">
                    <HeaderTemplate>
                    <thead>
                    <tr>
                        <td width="75%" height="30"><asp:Label ID="AUTO_TEAM_MEMBER_NAME" runat="server" /></td>
                        <td width="10%"><asp:Label ID="AUTO_TEAM_MEMBER_MAJOR" runat="server" /></td>
                        <td width="15%"><asp:Label ID="AUTO_TEAM_OPTIONS" runat="server" /></td>
                    </tr>
                    </thead>
                    <tbody>
                    </HeaderTemplate>
                    
                    <ItemTemplate>
                    <tr>
                        <td height="30">
                            
                            <%# ((MemberBean)Container.DataItem).name %> <%# ((MemberBean)Container.DataItem).lastnameD %> <%# ((MemberBean)Container.DataItem).lastnameM %>
                            </a>
                        </td>
                        <td><%# ((MemberBean)Container.DataItem).major %></td>
                        <td>
                            <a href="ViewProfile.aspx?Uid=<%# ((MemberBean)Container.DataItem).userId %>">
                                <img src= "images/user_info_tool.png" title="Ver Perfil" border="0" />
                            </a>
                            <a href="mailto:<%# ((MemberBean)Container.DataItem).email %>">
                                <img src= "images/user_sendmessage_tool.png" title="Enviar e-mail" border="0" />
                            </a>
                            <% if (userRoleField.Value.Equals("1"))
                               { %>
                            <a href="?opId=del&Uid=<%# ((MemberBean)Container.DataItem).userId %>&teamId=<%# teamIdHF.Value %>&teamOId=<%# teamOIDHF.Value %>">
                                <img src= "images/user_delete.png" title="Eliminar" border="0" />
                            </a>
                            <% } %>
                         </td>
                        
                    </tr>
                    </ItemTemplate>
                    
                    <FooterTemplate>
                        </tbody>
                    </FooterTemplate>
                </asp:Repeater>
                </table>
                <!-- <span class="h2projects"><asp:Label ID="AUTO_TEAM_MEMBER" runat="server" />: </span>
                <asp:Label ID="lblRole" runat="server" />
                <asp:Button ID="AUTO_TEAMS_MESSAGE" runat="server" name="messageButton" size="20"
                    OnClientClick="this.disabled = true;" UseSubmitBehavior="False" />
                <asp:Button ID="AUTO_TEAMS_BECOME" runat="server" name="becomeButton" size="20" OnClientClick="this.disabled = true;"
                    UseSubmitBehavior="False" />
                <asp:Button ID="AUTO_TEAMS_DELETE" runat="server" name="deleteButton" size="20" OnClientClick="this.disabled = true;"
                    UseSubmitBehavior="False" />-->
            </p>
            <!-- Due to limitations, the team and team members will be available on a dropdown listbox. -->
        </div>
        <div class="contenttext">
            <h1>
                <a href="?opId=leave&teamId=<%# ((TeamBean)Container.DataItem).teamId %>">
                <% if (userRoleField.Value.Equals("0"))
                               { %>
                    <img src= "images/user_back.png" title="Dejar equipo" border="0" />
                    <% } %>
                </a>
                
                <a href="#" >
                    <img src="images/user_add.png" title="Agregar"  />
                </a>
                <a href="javascript:popup('TeamLocation.aspx?teamId=<%# ((TeamBean)Container.DataItem).teamId %>')" >
                    <img src="images/user_earth.png"  />
                </a>
            </h1>
        </div>
        <script type="text/javascript" language=javascript >
            function popup(sURL) {
                window.open(sURL, "Map", "width=475,height=400,scrollbars=no");
            } 
        </script>
        
        
    </div>
    
    <!-- End of Content of each Panel -->
 <br />
  </asp:Panel>
  </div>
  <ajaxToolkit:CollapsiblePanelExtender ID="CollapsiblePanelExtender1" runat="Server"
            TargetControlID="content"
            CollapsedSize="0"
            Collapsed="False"
            ExpandControlID="title"
            CollapseControlID="title"
            AutoCollapse="False"
            AutoExpand="False"
            ImageControlID="img"
            ExpandedImage="~/images/collapse.jpg"
            CollapsedImage="~/images/expand.jpg"
            ExpandDirection="Vertical"/>
 </ItemTemplate>
 </asp:Repeater>

</asp:Content>
